<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="telephone=no" name="format-detection">
    <title>老赖公示系统</title>
    <link rel="stylesheet" href="/laolaipro/Public/Home/css/weui.min.css">
    <link rel="stylesheet" href="/laolaipro/Public/Home/css/top.css">
    
</head>

<body class="bgeee">
    <div class="header-container">
        <div class="weui-cell">
            <div class="weui-cell__hd fs0">
                <img src="/laolaipro/Public/Home/img/lefticon.png" class="slimg" />
            </div>
            <div class="weui-cell__bd texcen">
                <p>举报信息</p>
            </div>
            <div class="weui-cell__ft col00f">
                <?php if($jubao['status'] == 0): ?>待发布
                <?php elseif($jubao['status'] == 1): ?>
                    已发布
                <?php elseif($jubao['status'] == 4): ?>
                    已撤销<?php endif; ?>
            </div>
        </div>
    </div>
    <div class="xq_container">
        <div class="pad10 colbbb">失信人资料</div>
        <div class="weui-cells mat0 uinput ">
            <div class="weui-cell">
                <div class="weui-cell__hd">姓名</div>
                <div class="weui-cell__bd">
                    <input type="text" name="name" class="weui-input name" placeholder="输入欠款人姓名" value="<?php echo ($jubao['name']); ?>">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">身份证号</div>
                <div class="weui-cell__bd">
                    <input type="text" name="idcardno" class="weui-input idcardno" placeholder="输入欠款人身份证号" value="<?php echo ($jubao['idcardno']); ?>">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">手机号码</div>
                <div class="weui-cell__bd">
                    <input type="tel" name="tel" class="weui-input tel" placeholder="输入欠款人手机号码" value="<?php echo ($jubao['tel']); ?>">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">是否失联</div>
                <div class="weui-cell__bd">
                    <label>
                        <input class="online" type="radio" name="online" value="1" <?php if($jubao['online'] == 1): ?>checked<?php endif; ?> >
                        未失联
                    </label>
                    <label>
                        <input class="online" type="radio" name="online" value="0" <?php if($jubao['online'] == 0): ?>checked<?php endif; ?> >
                        已失联
                    </label>

                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">现居住地</div>
                <div class="weui-cell__bd">
                    <input type="text" name="area" class="weui-input area" placeholder="输入欠款人居住地" value="<?php echo ($jubao['area']); ?>">
                </div>
            </div>
        </div>

        <div class="pad10 colbbb">失信记录</div>
        <div class="weui-cells mat0 uinput">
            <div class="weui-cell">
                <div class="weui-cell__hd">欠款总额</div>
                <div class="weui-cell__bd">
                    <input type="text" name="money" class="weui-input money" placeholder="输入欠款数(元)" value="<?php echo ($jubao['money']); ?>">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">借款日期</div>
                <div class="weui-cell__bd">
                    <input type="date" name="ctime" class="weui-input ctime" placeholder="输入欠款人日期" value="<?php echo ($jubao['ctime']); ?>">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">到期日期</div>
                <div class="weui-cell__bd">
                    <input type="date" name="etime" class="weui-input etime" placeholder="输入到期日期" value="<?php echo ($jubao['etime']); ?>">
                </div>
            </div>
        </div>

        <div class="pad10 colbbb">欠款凭据(请上传真实有效的借款凭据)</div>
        <div class="weui-cells mat0 uinput">
            <div class="weui-uploader__bd pad10">
                
                <ul class="weui-uploader__files" id="uploaderFiles">
                    <li class="weui-uploader__file weui-uploader__file_status" style="background-image:url('<?php echo ($picsrc); ?>')">
                        <div class="weui-uploader__file-content">
                        </div>
                    </li>
                </ul>
                <?php if($jubao['status'] == 0): ?><div class="weui-uploader__input-box">
                    <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*" multiple />
                </div><?php endif; ?>
            </div>
        </div>

        <div class="pad10 colbbb">其他描述(选填)</div>
        <div class="weui-cells weui-cells_form mat0">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <textarea class="weui-textarea remark" placeholder="输入借款情况描述" rows="3" name="remark"><?php echo ($jubao['remark']); ?></textarea>
                </div>
            </div>
        </div>

        <div class="pad10 colbbb">主要联系人信息(审核属实后，曝光信息将短信通知亲友，有效提高催收效果)</div>
        <div class="weui-cells mat0 uinput ">
            <div class="weui-cell">
                <div class="weui-cell__hd">姓名</div>
                <div class="weui-cell__bd">
                    <input type="text" name="llname" class="weui-input llname" placeholder="输入亲友姓名" value="<?php echo ($reldata['name']); ?>">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">关系</div>
                <div class="weui-cell__bd">
                    <input type="text" name="llrelation" class="weui-input llrelation" placeholder="输入亲友关系" value="<?php echo ($reldata['relation']); ?>">
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">手机号码</div>
                <div class="weui-cell__bd">
                    <input type="text" name="lltel" class="weui-input lltel" placeholder="输入手机号码" value="<?php echo ($reldata['tel']); ?>">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">联系地址</div>
                <div class="weui-cell__bd">
                    <input type="text" name="lladdress" class="weui-input lladdress" placeholder="输入主要联系人的联系地址" value="<?php echo ($reldata['address']); ?>">
                </div>
            </div>
        </div>
        <?php if($jubao['status'] == 0): ?><div class="ih30 texcen colbbb">
                <!--<div><span class="icon iconadd">添加更多联系人</span></div>-->
                点击“下一步”即表示您同意<a class="col00f">《平台免责协议》</a>
            </div>
            <div class="weui-btn-area">
                <a class="weui-btn col00f bgfff" id="chexiao">撤销清单</a>
            </div>

            <div class="weui-btn-area">
                <a class="weui-btn bg00f" id="showTooltips">修改</a>
            </div><?php endif; ?>
    </div>
</body>

<script src="/laolaipro/Public/Home/js/jquery.js"></script>
<script src="/laolaipro/Public/Home/js/zepto.min.js"></script>
<script src="/laolaipro/Public/Home/js/layer/layer.js"></script>
<script src="/laolaipro/Public/Home/js/public.js"></script>

	<script>
        var pic = "";
        var id = "<?php echo ($jubao['id']); ?>";
        $("#chexiao").on('click',function () {
            requestUrl("<?php echo U('Jubao/chej');?>",{id:id},function ( res ) {
                layer.msg( res.message );
                if ( res.flag == "success") {
                    setTimeout(function () {
                        location.reload();
                    })
                }
            });
        });

		$("#showTooltips").on('click',function () {
            
            var reid = "<?php echo ($reldata['id']); ?>";
			var name = $(".name").val();
			var idcardno = $(".idcardno").val();
			var tel = $(".tel").val();
			var online = $(".online:checked").val();
			var area = $(".area").val();
			var money = $(".money").val();
			var ctime = $(".ctime").val();
			var etime = $(".etime").val();
			var remark = $(".remark").val();
			var llname = $(".llname").val();
			var llrelation = $(".llrelation").val();
			var lltel = $(".lltel").val();
			var lladdress = $(".lladdress").val();

			if ( name && idcardno && tel && online && area && money && ctime && etime && remark && llname && llrelation && lltel && lladdress) {
				var dataobj ={
                    id :id,
                    reid :reid,
					name : name,
					idcardno : idcardno,
					tel : tel,
					online : online,
					area : area,
					money : money,
					ctime : ctime,
					etime : etime,
					remark : remark,
					llname : llname,
					llrelation : llrelation,
					lltel : lltel,
					lladdress : lladdress,
					pic : pic
				};
                requestUrl("<?php echo U('Jubao/updjinfo');?>",dataobj,function ( res ) {
                    if ( res.flag == "success") {
                        console.log( res );
                        window.location.href = "<?php echo U('Jubao/jbres');?>/cardid/"+dataobj.cardid;
                    }else{
                        layer.msg( res.message );
                    }
                });
			}else{
				layer.msg("数据填写不完整！");
				console.log(name, idcardno, tel, online, area, money, ctime, etime, remark, llname, llrelation, lltel, lladdress);
			}
		});

	function ajax(){
		var filesize = this.files[0].size;
		if (filesize > 500*1024) {
			alert("请上传大小在500k以下的图片");
			return false;
		};
		var self = $(this);
		var files = this.files;
		var picname = files[0].name;
		var reader = new FileReader();
		reader.onload = function(e){
			var src = e.target.result;
			$.ajax({
                type:"post",
                url:"<?php echo U('Jubao/uploadPic');?>",
                data: {"pic":src,"pic_name":picname},
                dataType : "json",
                success : function(res){
                	if (res.flag == "success") {
                		pic =res.data;
                		console.log(pic);
                		$("#uploaderFiles").html('<li class="weui-uploader__file weui-uploader__file_status" style="background-image:url('+pic+')">'
		                        +'<div class="weui-uploader__file-content">'
		                        +'</div>'
		                    +'</li>');
                	}else{
                		alert(res.message);
                	}
                }
            });
		}
		reader.readAsDataURL(files[0]);
	}
	$("input[type='file']").on('change',ajax);
	</script>

</html>